﻿using System;

namespace $RootNamespace$
{
    static class Client
    {
        public static void Test()
        {
            // Create proxy and request a service 
            $ISubject$ subject = new $Proxy$();
            subject.$Request$();
        }
    }
    // "$ISubject$" 
    interface $ISubject$
    {
        void $Request$();
    }


    // $Proxy$ class
    class $Proxy$ : $ISubject$
    {
        $RealSubject$ _realSubject;
        $RealSubject$ realSubject
        {
            get
            {//  'lazy initialization' 
                if (_realSubject == null)
                    _realSubject = new $RealSubject$();
                return _realSubject;
            }
            set { _realSubject = value; }
        }

        public void $Request$()
        {
             realSubject.$Request$();
        }
    }
    // $RealSubject$ class
    class $RealSubject$ : $ISubject$
    {

        public void $Request$()
        {
            Console.WriteLine("Called " + this.GetType().ToString() + ".$Request$()");
        }
    }
}
